package com.jycrm.dao.core;

import java.sql.Connection;
import java.util.List;

import org.springframework.orm.hibernate.HibernateCallback;

public interface QueryManager {
    
    /**
     * get object from db by Long id
     * @param entity, Class
     * @param id, Long type
     * @return Object
     */
	public Object getObjectById(Class entity, Long id);
    
    /**
     * get object from db by String id
     * @param entity, Class
     * @param id, id type is String
     * @return Object
     */
    public Object getObjectById(Class entity, String id);
    
    /**
     * get object from db by String id
     * @param entity, Class
     * @param id, id type is String
     * @return Object
     */
    
    public Object getObjectByStringId(Class entity, String id);
	
    /**
     * get Object List by HQL defined in XXX.hbm.xml
     * @param query HQL 
     * @return Object List
     */
	public List findByNamedQuery(String query);
    
    /**
     * get Object List by HQL defined in XXX.hbm.xml
     * @param query HQL
     * @param parameter parameter in hql  
     * @return Object List
     */
    public List findByNamedQuery(String query, Object parameter);
    
    /**
     * get Object List by HQL defined in XXX.hbm.xml
     * @param query HQL
     * @param parameter parameters in hql  
     * @return Object List
     */   
    public List findByNamedQuery(String query, Object[] parameter);
    
    /**
     * get Object List from
     * @param query, HQL
     * @return Object List
     */
    public List find(String query);
    
    /**
     * get Object List by hql and parameters 
     * @param query       HQL
     * @param parameters  parameters
     * @return Object List
     */
    public List find(String query,Object[] parameters);
    
    public List findPagination(HibernateCallback arg0);
    
    public Object execute(HibernateCallback arg0) ;
    
}
